home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / f2c / may_5_92.lha / f2c.VMay_5_1992 / libF77 / h_indx.c < prev    next >
C/C++ Source or Header  |  1992-05-07  |  300b  |  27 lines

  1. #include "f2c.h"
  2.  
  3. extern integer s_cmp();
  4.  
  5. shortint h_indx(a, b, la, lb)
  6. char *a, *b;
  7. ftnlen la, lb;
  8. {
  9. int i, n;
  10. char *s, *t, *bend;
  11.  
  12. n = la - lb + 1;
  13. bend = b + lb;
  14.  
  15. for(i = 0 ; i < n ; ++i)
  16.     {
  17.     s = a + i;
  18.     t = b;
  19.     while(t < bend)
  20.         if(*s++ != *t++)
  21.             goto no;
  22.     return(i+1);
  23.     no: ;
  24.     }
  25. return(0);
  26. }
  27.